<template>
  <div class="addAddress">
    <nut-button shape="square" type="info" color="#F0A93F" block @click="addAddress">添加地址</nut-button>
  </div>
</template>

<script lang="ts">
import Taro, { useRouter } from '@tarojs/taro';
import { reactive, toRefs, onMounted } from 'vue';
import { } from '../../../../api/index'
export default {
  components: {

  },
  setup() {
    const data = reactive({
      cartItemIds: [] as any
    });
    onMounted(() => {
      const router = useRouter();
      if (router.params.cartItemIds) {
        data.cartItemIds = router.params.cartItemIds
      }
    });
    const addAddress = () => {
      Taro.navigateTo({ url: '/packageA/pages/writeAddress/index?cartItemIds=' + data.cartItemIds });
    }
    return {
      ...toRefs(data), addAddress,
    }
  }
};
</script>


<style lang="scss">
.addAddress {
  position: fixed;
  bottom: 0;
  left: 0;
  background: #fff;
  padding: 20rpx 40rpx;
  box-sizing: border-box;
  width: 100%;
  text-align: center;

  .nut-button {
    margin: 0 auto;
    border-radius: 10rpx;
    background: #21C38F;
  }
}
</style>